﻿{extend name="public:base" /}

{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-content">
                    <div class="row search-form">
                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group">
                                <input placeholder="请输入手机号" name="mobile" value="{:input('mobile')}" type="text" class="form-control form-control-lg">
                            </div>
                        </div>
                        <div class="col-sm-2 m-b-sm">
                            <select class="form-control" name="up_user_id">
                                <option value="0">请选择推广员</option>
                                {volist name="spread_user_list" id="vo"}
                                <option value="{$vo.id}" {$vo.id == input('up_user_id') ? 'selected' : ''}>{$vo.username}</option>
                                {/volist}
                            </select>
                        </div>

                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group" style="width: 100%; display: flex; justify-content: space-between">
                                <button type="button" class="btn btn-primary btn-lg screen-btn">搜索</button>
                            </div>
                        </div>
                    </div>

                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>头像</th>
                                <th>昵称</th>
                                <th>手机号</th>
                                <th>推广员</th>
                                <th>状态</th>
                                <th>注册时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="vo"}
                            <tr>
                                <td>{$vo.id}</td>
                                <td>
                                    <img src="{$vo.avatar == '../../static/images/avatar.png' ? '__ADMIN__/img/avatar.png' : $vo.avatar}" style="width: 100px;height: 100px; object-fit: cover; border-radius: 50%"/>
                                </td>
                                <td>{$vo.username}</td>
                                <td>{$vo.mobile}</td>
                                <td>{:getUsername($vo.up_user_id)}</td>
                                <td>{$vo.status == 1 ? '启用' : '禁用'}</td>
                                <td>{:timeFormat($vo.create_time, 'Y-m-d')}</td>
                                <td>
                                    {if $vo.status == 1}
                                    <a href="{:url(doUserStatus, ['id' => $vo.id, 'status' => 2])}" class="btn btn-white btn-sm ajax-operate"><i class="iconfont icon-refuse"></i> 禁用 </a>
                                    {else /}
                                    <a href="{:url(doUserStatus, ['id' => $vo.id, 'status' => 1])}" class="btn btn-white btn-sm ajax-operate"><i class="iconfont icon-success"></i> 启用 </a>
                                    {/if}

                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                        {if !empty($list)}{$list->render()}{/if}
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>{include file="public/preview-img-mask" swiper-id="cropper-preview" /}{/block}

